﻿@using Aspire.Dashboard.Model
@using Aspire.Dashboard.Extensions
@using Aspire.Dashboard.Resources
@inject IStringLocalizer<Columns> Loc

@if (ContentAfterValue is not null)
{
    <GridValue Value="@Value"
               ValueToCopy="@ValueToCopy"
               EnableHighlighting="true"
               HighlightText="@FilterText"
               PreCopyToolTip="@Loc[nameof(Columns.SourceColumnDisplayCopyCommandToClipboard)]"
               ToolTip="@Tooltip">
        <ContentAfterValue>
            <span class="subtext">@ContentAfterValue</span>
        </ContentAfterValue>
    </GridValue>
}
else
{
    <GridValue Value="@Value"
               ValueToCopy="@ValueToCopy"
               EnableHighlighting="true"
               HighlightText="@FilterText"
               PreCopyToolTip="@Loc[nameof(Columns.SourceColumnSourceCopyFullPathToClipboard)]"
               ToolTip="@Tooltip" />
}

@code {
    [Parameter, EditorRequired]
    public required ResourceViewModel Resource { get; set; }

    [Parameter, EditorRequired]
    public required string FilterText { get; set; }

    [Parameter, EditorRequired]
    public required string Value { get; set; }

    [Parameter]
    public required string? ContentAfterValue { get; set; }

    [Parameter, EditorRequired]
    public required string ValueToCopy { get; set; }

    [Parameter, EditorRequired]
    public required string Tooltip { get; set; }

}
